using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Decision.BusinessLayer.DataLayer;

namespace Decision.BusinessLayer
{
    public class DCS_COURT_APPEALSFactory
    {

        #region data Members

        DCS_COURT_APPEALSSql _dataObject = null;

        #endregion

        #region Constructor

        public DCS_COURT_APPEALSFactory()
        {
            _dataObject = new DCS_COURT_APPEALSSql();
        }

        #endregion


        #region Public Methods

        /// <summary>
        /// Insert new DCS_COURT_APPEALS
        /// </summary>
        /// <param name="businessObject">DCS_COURT_APPEALS object</param>
        /// <returns>true for successfully saved</returns>
        public bool Insert(DCS_COURT_APPEALS businessObject)
        {

            return _dataObject.Insert(businessObject);

        }

        /// <summary>
        /// Update existing DCS_COURT_APPEALS
        /// </summary>
        /// <param name="businessObject">DCS_COURT_APPEALS object</param>
        /// <returns>true for successfully saved</returns>
        public bool Update(DCS_COURT_APPEALS businessObject)
        {

            return _dataObject.Update(businessObject);
        }

        /// <summary>
        /// get DCS_COURT_APPEALS by primary key.
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>Student</returns>
        public DCS_COURT_APPEALS GetByPrimaryKey(DCS_COURT_APPEALSKeys keys)
        {
            return _dataObject.SelectByPrimaryKey(keys); 
        }

        /// <summary>
        /// get list of all DCS_COURT_APPEALSs
        /// </summary>
        /// <returns>list</returns>
        public List<DCS_COURT_APPEALS> GetAll()
        {
            return _dataObject.SelectAll(); 
        }

        /// <summary>
        /// get list of DCS_COURT_APPEALS by field
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>list</returns>
        public List<DCS_COURT_APPEALS> GetAllBy(DCS_COURT_APPEALS.DCS_COURT_APPEALSFields fieldName, object value)
        {
            return _dataObject.SelectByField(fieldName.ToString(), value);  
        }

        /// <summary>
        /// delete by primary key
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>true for succesfully deleted</returns>
        public bool Delete(DCS_COURT_APPEALSKeys keys)
        {
            return _dataObject.Delete(keys); 
        }

        /// <summary>
        /// delete DCS_COURT_APPEALS by field.
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>true for successfully deleted</returns>
        public bool Delete(DCS_COURT_APPEALS.DCS_COURT_APPEALSFields fieldName, object value)
        {
            return _dataObject.DeleteByField(fieldName.ToString(), value); 
        }

        #endregion

    }
}
